//package com.dy.domemain.utils;
//
//import com.alibaba.otter.canal.client.CanalConnector;
//import com.alibaba.otter.canal.client.CanalConnectors;
//import com.alibaba.otter.canal.common.utils.AddressUtils;
//
//import java.net.InetSocketAddress;
//
///**
// * 单机模式的测试例子
// *
// * @author jianghang 2013-4-15 下午04:19:20
// * @version 1.0.4
// */
//public class SimpleCanalClientTest {
//
//    public SimpleCanalClientTest(String destination) {
//    }
//
//    public static void main(String args[]) {
//        // 根据ip，直接创建链接，无HA的功能
//        String destination = "example";
//        String ip = AddressUtils.getHostIp();
//        CanalConnector connector = CanalConnectors.newSingleConnector(new InetSocketAddress("127.0.0.1", 11111),
//                destination, "canal", "canal");
//
//        final SimpleCanalClientTest clientTest = new SimpleCanalClientTest(destination);
//        clientTest.setConnector(connector);
//        clientTest.start();
//        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
//            try {
//                logger.info("## stop the canal client");
//                clientTest.stop();
//            } catch (Throwable e) {
//                logger.warn("##something goes wrong when stopping canal:", e);
//            } finally {
//                logger.info("## canal client is down.");
//            }
//        }));
//    }
//
//}